<template>
  <div class="container">
    <img src="@/assets/pic/ic_nav_user@2x.png" @click="$router.push({path: '/permission'})">
    <img src="@/assets/pic/ic_nav_quit@2x.png" @click="outShow = true">

    <!-- 退出 -->
    <el-dialog class="delSelForm" :visible.sync="outShow" width="30%" top="30vh" :modal="false">
      <img src="@/assets/pic/img1@2x.png">
      <h1>退出</h1>
      <h3>确认退出至登录页面</h3>
      <div class="delSel">
        <p class="delete" @click="out">退出</p>
        <p class="cancel" @click="outShow = false">我再想想</p>
      </div>
    </el-dialog>
  </div>
</template>

<script>
// import { getRouter } from '@/utils/auth'
export default {
  data() {
    return {
      outShow: false
    }
  },
  computed: {
    // hasLimit() {
    //   return getRouter().filter(item => item.meta === '权限').length
    // }
  },
  methods: {
    // 前往权限管理
    toPermission() {
      this.$router.push({ path: '/permission' })
    },
    // 退出页面
    out() {
      this.$store.dispatch('LogOut').then(() => { // 拉取路由
        this.$router.push({ path: '/login' })
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  display: flex;
  align-items: center;
  margin-right: 0.5rem;
  img {
    width: 0.28rem;
    height: 0.28rem;
    margin-left: 0.2rem;
    cursor: pointer;
  }
}
</style>
